const KEY = 'bignews-vue'

//1.保存token
function saveToken(obj) {
  localStorage.setItem(KEY, JSON.stringify(obj))
}

//2.取token
function getToken() {
  return JSON.parse(localStorage.getItem(KEY))
}

//3.删除token
function removeToken() {
  localStorage.removeItem(KEY)
}

//导出接口
export {
  saveToken,
  getToken,
  removeToken
}
